﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace DLL.Entities
{
    public class Utility
    {
        public static void LogFile(string strLogText)
        {
            StreamWriter log;

            if (!File.Exists("..\\..\\..\\DLL\\Logs\\logfile.txt"))
            {
                log = new StreamWriter("..\\..\\..\\DLL\\Logs\\logfile.txt");
            }
            else
            {
                log = File.AppendText("..\\..\\..\\DLL\\Logs\\logfile.txt");
            }

            // Write to the file:
            log.WriteLine(DateTime.Now);
            log.WriteLine(strLogText);
            log.WriteLine();

            // Close the stream:
            log.Close();

        }

        public static int Random(int min, int max)
        {
            Random num = new Random((int)DateTime.Now.Ticks);
            return num.Next(min, max);
        }
    }
}
